from utils.install_tools.exception import ValueNotFoundError

_cache_config = {}


class CacheHandler:
    @staticmethod
    def get_cache(cache_date):
        try:
            return _cache_config[cache_date]
        except KeyError:
            raise ValueNotFoundError(f"{cache_date}在缓存中未找到，检查是否将该数据存储缓存中")

    @staticmethod
    def update_cache(*, cache_name, cache_value):
        print(cache_name, cache_value)
        _cache_config[cache_name] = cache_value
